#ifndef GFUNC_H_
#define GFUNC_H_

#include "CrossDefine.h"
#include "FileOP.h"

class GFunc
{
public:
    static BaseFile * BaseFile_Create_File(const char * p_file_name, const char *mode);
    static BaseFile * BaseFile_Create(unsigned long mem_len, int mem_unit = 1024);
    static BaseFile * BaseFile_Create_m(char const *p_content_buffer, long file_size, int mem_unit = 1024);

    static size_t BaseFile_Read(void *buffer, size_t size, size_t count, BaseFile * p_file);
    static size_t BaseFile_Write(const void *buffer, size_t size, size_t count, BaseFile * p_file);

    static unsigned char * BaseFile_Get_mem_data(BaseFile * p_basefile);

    static void BaseFile_Close(BaseFile * p_basefile);

    static void BaseFile_Seek(BaseFile * p_basefile, long pos=0, int origin=SEEK_SET);

    static size_t BaseFile_tell(BaseFile * p_basefile);

    static size_t BaseFile_size(BaseFile * p_basefile);

    static bool BaseFile_EOF(BaseFile * p_file);

    static size_t BaseFile_ReadLine(char *buffer, int max_len, BaseFile * p_file);

    static int compress_content_in_mem(const char * p_src_content, int src_len, char ** p_compr_content);
};

#endif